﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="生产进度日报表2.aspx.cs" Inherits="syc.Produce.生产进度日报表2" %>
<html>
<head>
<style>
#op{display:none;}
</style>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>
<form id="form1" runat="server">
<%
    int i;
    jindu1 = new decimal[44];
    jindu2 = new decimal[48];
    jindu3 = new int[66];
    jindu4 = new int[15];
    jindu5 = new decimal[26];
    
    this.Conn.ConnectionString = ConfigurationManager.ConnectionStrings["SCMConnectionString1"].ConnectionString;
    this.Conn.Open();
    this.Cmd.Connection = Conn;

    this.Cmd.CommandText =
"select 分厂ID,锁定 from 生产进度 where 锁定=0 and 日期='"
+ this.d1.ToShortDateString() + "'"
+ " union select 3 as 分厂ID,锁定 from 生产进度3 where 锁定=0 and 日期='"
+ this.d1.ToShortDateString() + "'"
+ " union select 4 as 分厂ID,锁定 from 生产进度4 where 锁定=0 and 日期='"
+ this.d1.ToShortDateString() + "'"
;
    for (i = 1; i <= 5; i++)
    {
        ((Image)(this.FindControl("Image" + i))).ImageUrl = "/images/shangbao-1.png";
    }

    this.Cmd.CommandType = System.Data.CommandType.Text;
    this.Reader = Cmd.ExecuteReader();
    while (this.Reader.Read())
    {
        ((Image)(this.FindControl("Image" + (int)this.Reader[0]))).ImageUrl = "/images/shangbao-0.png";
    }
    this.Reader.Close();

    string sql =
@"declare @y int;
declare @d1 date;
if exists(select * from 生产月设置 where 分厂=@fc and @d0>=起始日期 and @d0<=截止日期)
begin
	select @y=年度,@d1=起始日期 from 生产月设置 where 分厂=@fc and @d0>=起始日期 and @d0<=截止日期
	if exists(select * from 生产月设置 where 分厂=@fc and 年度=@y and 月份=1)
	begin
		select @d1 as 月累计日期,起始日期 as 年累计日期 from 生产月设置 where 分厂=@fc and 年度=@y and 月份=1
	end
end";//分厂每月扎帐日期设置查询语句
    
    //一分厂日进度
    this.Cmd.CommandText = sql.Replace("@d0", "'" + this.d1.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d0", "'" + this.d1.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@fc", "1");
    this.Reader = Cmd.ExecuteReader();
    if (this.Reader.Read())
    {
        this.d2 = (DateTime)this.Reader["月累计日期"];
        this.d3 = (DateTime)this.Reader["年累计日期"];
    }
    else
    {
        this.d2 = DateTime.Parse(this.d1.Year.ToString() + "-" + this.d1.Month.ToString() + "-1");
        this.d3 = DateTime.Parse(this.d1.Year.ToString() + "-1-1");
    }
    this.Reader.Close();

    this.Cmd.CommandText =
@"select * from
(select
ISNULL(SUM(车丝1),0) as 车丝1,
ISNULL(SUM(车丝2),0) as 车丝2,
ISNULL(SUM(车丝3),0) as 车丝3,
ISNULL(SUM(车丝4),0) as 车丝4
from 生产进度 where 分厂ID=1 and 日期=@d1
) t1
,
(select
ISNULL(SUM(车丝1),0) as 车丝1累计,
ISNULL(SUM(车丝2),0) as 车丝2累计,
ISNULL(SUM(车丝3),0) as 车丝3累计,
ISNULL(SUM(车丝4),0) as 车丝4累计
from 生产进度 where 分厂ID=1 and 日期>=@d2 and 日期<=@d1
) t2
,
(select
ISNULL(SUM(称测支数),0) as 套管称重测长支,
ISNULL(SUM(包装捆数),0) as 套管精整捆,
ISNULL(SUM(入库捆数),0) as 套管入库捆,
ISNULL(SUM(称测重量),0) as 套管称重测长kg,
ISNULL(SUM(包装重量),0) as 套管精整kg,
ISNULL(SUM(入库重量),0) as 套管入库kg
from 生产进度 where 分厂ID=1 and 产品类别ID=2 and 日期=@d1
) t3
,
(select
ISNULL(SUM(称测支数),0) as 套管称重测长累计支,
ISNULL(SUM(包装捆数),0) as 套管精整累计捆,
ISNULL(SUM(入库捆数),0) as 套管入库累计捆,
ISNULL(SUM(称测重量),0) as 套管称重测长累计kg,
ISNULL(SUM(包装重量),0) as 套管精整累计kg,
ISNULL(SUM(入库重量),0) as 套管入库累计kg
from 生产进度 where 分厂ID=1 and 产品类别ID=2 and 日期>=@d2 and 日期<=@d1
) t4
,
(select
ISNULL(SUM(称测支数),0) as 套管称重测长年累计支,
ISNULL(SUM(包装捆数),0) as 套管精整年累计捆,
ISNULL(SUM(入库捆数),0) as 套管入库年累计捆,
ISNULL(SUM(称测重量),0) as 套管称重测长年累计kg,
ISNULL(SUM(包装重量),0) as 套管精整年累计kg,
ISNULL(SUM(入库重量),0) as 套管入库年累计kg
from 生产进度 where 分厂ID=1 and 产品类别ID=2 and 日期>=@d3 and 日期<=@d1
) t5
,
(select
ISNULL(SUM(称测支数),0) as 套管2称重测长支,
ISNULL(SUM(包装捆数),0) as 套管2精整捆,
ISNULL(SUM(入库捆数),0) as 套管2入库捆,
ISNULL(SUM(称测重量),0) as 套管2称重测长kg,
ISNULL(SUM(包装重量),0) as 套管2精整kg,
ISNULL(SUM(入库重量),0) as 套管2入库kg
from 生产进度 where 分厂ID=1 and 产品类别ID=4 and 日期=@d1
) t6
,
(select
ISNULL(SUM(称测支数),0) as 套管2称重测长累计支,
ISNULL(SUM(包装捆数),0) as 套管2精整累计捆,
ISNULL(SUM(入库捆数),0) as 套管2入库累计捆,
ISNULL(SUM(称测重量),0) as 套管2称重测长累计kg,
ISNULL(SUM(包装重量),0) as 套管2精整累计kg,
ISNULL(SUM(入库重量),0) as 套管2入库累计kg
from 生产进度 where 分厂ID=1 and 产品类别ID=4 and 日期>=@d2 and 日期<=@d1
) t7
,
(select
ISNULL(SUM(称测支数),0) as 套管2称重测长年累计支,
ISNULL(SUM(包装捆数),0) as 套管2精整年累计捆,
ISNULL(SUM(入库捆数),0) as 套管2入库年累计捆,
ISNULL(SUM(称测重量),0) as 套管2称重测长年累计kg,
ISNULL(SUM(包装重量),0) as 套管2精整年累计kg,
ISNULL(SUM(入库重量),0) as 套管2入库年累计kg
from 生产进度 where 分厂ID=1 and 产品类别ID=4 and 日期>=@d3 and 日期<=@d1
) t8";
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d1", "'" + this.d1.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d2", "'" + this.d2.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d3", "'" + this.d3.ToShortDateString() + "'");

    this.Reader = Cmd.ExecuteReader();

    if (this.Reader.Read())
    {
        for (i = 0; i < Reader.FieldCount; i++)
        {
            if (Reader[i].GetType().Equals(i.GetType()))
            {
                jindu1[i] = (int)(Reader[i]);
            }
            else
            {
                jindu1[i] = (decimal)(Reader[i]);
            }
        }
    }
    Reader.Close();

    //二分厂日进度
    Cmd.CommandText = sql.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@fc", "2");

    Reader = Cmd.ExecuteReader();
    if (this.Reader.Read())
    {
        this.d2 = (DateTime)this.Reader["月累计日期"];
        this.d3 = (DateTime)this.Reader["年累计日期"];
    }
    else
    {
        this.d2 = DateTime.Parse(this.d1.Year.ToString() + "-" + this.d1.Month.ToString() + "-1");
        this.d3 = DateTime.Parse(this.d1.Year.ToString() + "-1-1");
    }
    Reader.Close();

    Cmd.CommandText =
@"select * from
(select
ISNULL(SUM(车丝1),0) as 车丝1,
ISNULL(SUM(车丝2),0) as 车丝2,
ISNULL(SUM(车丝3),0) as 车丝3,
ISNULL(SUM(车丝4),0) as 车丝4,
ISNULL(SUM(车丝5),0) as 车丝5,
ISNULL(SUM(车丝6),0) as 车丝6
from 生产进度 where 分厂ID=2 and 日期=@d1
) t1
,
(select
ISNULL(SUM(车丝1),0) as 车丝1累计,
ISNULL(SUM(车丝2),0) as 车丝2累计,
ISNULL(SUM(车丝3),0) as 车丝3累计,
ISNULL(SUM(车丝4),0) as 车丝4累计,
ISNULL(SUM(车丝5),0) as 车丝5累计,
ISNULL(SUM(车丝6),0) as 车丝6累计
from 生产进度 where 分厂ID=2 and 日期>=@d2 and 日期<=@d1
) t2
,
(select
ISNULL(SUM(称测支数),0) as 套管称重测长支,
ISNULL(SUM(包装捆数),0) as 套管精整捆,
ISNULL(SUM(入库捆数),0) as 套管入库捆,
ISNULL(SUM(称测重量),0) as 套管称重测长kg,
ISNULL(SUM(包装重量),0) as 套管精整kg,
ISNULL(SUM(入库重量),0) as 套管入库kg
from 生产进度 where 分厂ID=2 and 产品类别ID=2 and 日期=@d1
) t3
,
(select
ISNULL(SUM(称测支数),0) as 套管称重测长累计支,
ISNULL(SUM(包装捆数),0) as 套管精整累计捆,
ISNULL(SUM(入库捆数),0) as 套管入库累计捆,
ISNULL(SUM(称测重量),0) as 套管称重测长累计kg,
ISNULL(SUM(包装重量),0) as 套管精整累计kg,
ISNULL(SUM(入库重量),0) as 套管入库累计kg
from 生产进度 where 分厂ID=2 and 产品类别ID=2 and 日期>=@d2 and 日期<=@d1
) t4
,
(select
ISNULL(SUM(称测支数),0) as 套管称重测长年累计支,
ISNULL(SUM(包装捆数),0) as 套管精整年累计捆,
ISNULL(SUM(入库捆数),0) as 套管入库年累计捆,
ISNULL(SUM(称测重量),0) as 套管称重测长年累计kg,
ISNULL(SUM(包装重量),0) as 套管精整年累计kg,
ISNULL(SUM(入库重量),0) as 套管入库年累计kg
from 生产进度 where 分厂ID=2 and 产品类别ID=2 and 日期>=@d3 and 日期<=@d1
) t5
,
(select
ISNULL(SUM(称测支数),0) as 油管称重测长支,
ISNULL(SUM(包装捆数),0) as 油管精整捆,
ISNULL(SUM(入库捆数),0) as 油管入库捆,
ISNULL(SUM(称测重量),0) as 油管称重测长kg,
ISNULL(SUM(包装重量),0) as 油管精整kg,
ISNULL(SUM(入库重量),0) as 油管入库kg
from 生产进度 where 分厂ID=2 and 产品类别ID=1 and 日期=@d1
) t6
,
(select
ISNULL(SUM(称测支数),0) as 油管称重测长累计支,
ISNULL(SUM(包装捆数),0) as 油管精整累计捆,
ISNULL(SUM(入库捆数),0) as 油管入库累计捆,
ISNULL(SUM(称测重量),0) as 油管称重测长累计kg,
ISNULL(SUM(包装重量),0) as 油管精整累计kg,
ISNULL(SUM(入库重量),0) as 油管入库累计kg
from 生产进度 where 分厂ID=2 and 产品类别ID=1 and 日期>=@d2 and 日期<=@d1
) t7
,
(select
ISNULL(SUM(称测支数),0) as 油管称重测长年累计支,
ISNULL(SUM(包装捆数),0) as 油管精整年累计捆,
ISNULL(SUM(入库捆数),0) as 油管入库年累计捆,
ISNULL(SUM(称测重量),0) as 油管称重测长年累计kg,
ISNULL(SUM(包装重量),0) as 油管精整年累计kg,
ISNULL(SUM(入库重量),0) as 油管入库年累计kg
from 生产进度 where 分厂ID=2 and 产品类别ID=1 and 日期>=@d3 and 日期<=@d1
) t8
";
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d1", "'" + this.d1.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d2", "'" + this.d2.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d3", "'" + this.d3.ToShortDateString() + "'");

    Reader = Cmd.ExecuteReader();

    if (Reader.Read())
    {
        for (i = 0; i < Reader.FieldCount; i++)
        {
            if (Reader[i].GetType().Equals(i.GetType()))
            {
                jindu2[i] = (int)(Reader[i]);
            }
            else
            {
                jindu2[i] = (decimal)(Reader[i]);
            }
        }
    }
    Reader.Close();


    //五分厂日进度
    Cmd.CommandText = sql.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@fc", "5");

    Reader = Cmd.ExecuteReader();
    if (this.Reader.Read())
    {
        this.d2 = (DateTime)this.Reader["月累计日期"];
        this.d3 = (DateTime)this.Reader["年累计日期"];
    }
    else
    {
        this.d2 = DateTime.Parse(this.d1.Year.ToString() + "-" + this.d1.Month.ToString() + "-1");
        this.d3 = DateTime.Parse(this.d1.Year.ToString() + "-1-1");
    }
    Reader.Close();

    Cmd.CommandText =
@"select * from
(select
ISNULL(SUM(车丝1),0) as 车丝1,
ISNULL(SUM(车丝2),0) as 车丝2,
ISNULL(SUM(车丝3),0) as 车丝3,
ISNULL(SUM(车丝4),0) as 车丝4
from 生产进度 where 分厂ID=5 and 日期=@d1
) t1
,
(select
ISNULL(SUM(车丝1),0) as 车丝1累计,
ISNULL(SUM(车丝2),0) as 车丝2累计,
ISNULL(SUM(车丝3),0) as 车丝3累计,
ISNULL(SUM(车丝4),0) as 车丝4累计
from 生产进度 where 分厂ID=5 and 日期>=@d2 and 日期<=@d1
) t2
,
(select
ISNULL(SUM(称测支数),0) as 油管称重测长支,
ISNULL(SUM(包装捆数),0) as 油管精整捆,
ISNULL(SUM(入库捆数),0) as 油管入库捆,
ISNULL(SUM(称测重量),0) as 油管称重测长kg,
ISNULL(SUM(包装重量),0) as 油管精整kg,
ISNULL(SUM(入库重量),0) as 油管入库kg
from 生产进度 where 分厂ID=5 and 产品类别ID=1 and 日期=@d1
) t3
,
(select
ISNULL(SUM(称测支数),0) as 油管称重测长累计支,
ISNULL(SUM(包装捆数),0) as 油管精整累计捆,
ISNULL(SUM(入库捆数),0) as 油管入库累计捆,
ISNULL(SUM(称测重量),0) as 油管称重测长累计kg,
ISNULL(SUM(包装重量),0) as 油管精整累计kg,
ISNULL(SUM(入库重量),0) as 油管入库累计kg
from 生产进度 where 分厂ID=5 and 产品类别ID=1 and 日期>=@d2 and 日期<=@d1
) t4
,
(select
ISNULL(SUM(称测支数),0) as 套管称重测长年累计支,
ISNULL(SUM(包装捆数),0) as 套管精整年累计捆,
ISNULL(SUM(入库捆数),0) as 套管入库年累计捆,
ISNULL(SUM(称测重量),0) as 套管称重测长年累计kg,
ISNULL(SUM(包装重量),0) as 套管精整年累计kg,
ISNULL(SUM(入库重量),0) as 套管入库年累计kg
from 生产进度 where 分厂ID=5 and 产品类别ID=1 and 日期>=@d3 and 日期<=@d1
) t5";
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d1", "'" + this.d1.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d2", "'" + this.d2.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d3", "'" + this.d3.ToShortDateString() + "'");
    
    Reader = Cmd.ExecuteReader();

    if (Reader.Read())
    {
        for (i = 0; i < Reader.FieldCount; i++)
        {
            if (Reader[i].GetType().Equals(i.GetType()))
            {
                jindu5[i] = (int)(Reader[i]);
            }
            else
            {
                jindu5[i] = (decimal)(Reader[i]);
            }
        }
    }
    Reader.Close();




    //三分厂日进度
    Cmd.CommandText = sql.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@fc", "3");

    Reader = Cmd.ExecuteReader();
    if (this.Reader.Read())
    {
        this.d2 = (DateTime)this.Reader["月累计日期"];
        this.d3 = (DateTime)this.Reader["年累计日期"];
    }
    else
    {
        this.d2 = DateTime.Parse(this.d1.Year.ToString() + "-" + this.d1.Month.ToString() + "-1");
        this.d3 = DateTime.Parse(this.d1.Year.ToString() + "-1-1");
    }
    Reader.Close();


    Cmd.CommandText =
@"select * from
(select
ISNULL(SUM(车丝1),0) as 车丝1,
ISNULL(SUM(车丝2),0) as 车丝2,
ISNULL(SUM(车丝3),0) as 车丝3,
ISNULL(SUM(车丝4),0) as 车丝4,
ISNULL(SUM(车丝5),0) as 车丝5,
ISNULL(SUM(车丝6),0) as 车丝6,
ISNULL(SUM(车丝7),0) as 车丝7,
ISNULL(SUM(车丝8),0) as 车丝8,
ISNULL(SUM(车丝9),0) as 车丝9,
ISNULL(SUM(车丝10),0) as 车丝10,
ISNULL(SUM(车丝11),0) as 车丝11,
ISNULL(SUM(车丝12),0) as 车丝12,
ISNULL(SUM(车丝13),0) as 车丝13,
ISNULL(SUM(车丝14),0) as 车丝14,
ISNULL(SUM(车丝15),0) as 车丝15,
ISNULL(SUM(车丝16),0) as 车丝16,
ISNULL(SUM(车丝17),0) as 车丝17,
ISNULL(SUM(车丝18),0) as 车丝18,
ISNULL(SUM(车丝19),0) as 车丝19,
ISNULL(SUM(车丝20),0) as 车丝20
from 生产进度3 where 日期=@d1
) t1
,
(select
ISNULL(SUM(车丝1),0) as 车丝1累计,
ISNULL(SUM(车丝2),0) as 车丝2累计,
ISNULL(SUM(车丝3),0) as 车丝3累计,
ISNULL(SUM(车丝4),0) as 车丝4累计,
ISNULL(SUM(车丝5),0) as 车丝5累计,
ISNULL(SUM(车丝6),0) as 车丝6累计,
ISNULL(SUM(车丝7),0) as 车丝7累计,
ISNULL(SUM(车丝8),0) as 车丝8累计,
ISNULL(SUM(车丝9),0) as 车丝9累计,
ISNULL(SUM(车丝10),0) as 车丝10累计,
ISNULL(SUM(车丝11),0) as 车丝11累计,
ISNULL(SUM(车丝12),0) as 车丝12累计,
ISNULL(SUM(车丝13),0) as 车丝13累计,
ISNULL(SUM(车丝14),0) as 车丝14累计,
ISNULL(SUM(车丝15),0) as 车丝15累计,
ISNULL(SUM(车丝16),0) as 车丝16累计,
ISNULL(SUM(车丝17),0) as 车丝17累计,
ISNULL(SUM(车丝18),0) as 车丝18累计,
ISNULL(SUM(车丝19),0) as 车丝19累计,
ISNULL(SUM(车丝20),0) as 车丝20累计
from 生产进度3 where 日期>=@d2 and 日期<=@d1
) t2
,
(select
ISNULL(SUM(车丝1),0) as 车丝1年累计,
ISNULL(SUM(车丝2),0) as 车丝2年累计,
ISNULL(SUM(车丝3),0) as 车丝3年累计,
ISNULL(SUM(车丝4),0) as 车丝4年累计,
ISNULL(SUM(车丝5),0) as 车丝5年累计,
ISNULL(SUM(车丝6),0) as 车丝6年累计,
ISNULL(SUM(车丝7),0) as 车丝7年累计,
ISNULL(SUM(车丝8),0) as 车丝8年累计,
ISNULL(SUM(车丝9),0) as 车丝9年累计,
ISNULL(SUM(车丝10),0) as 车丝10年累计,
ISNULL(SUM(车丝11),0) as 车丝11年累计,
ISNULL(SUM(车丝12),0) as 车丝12年累计,
ISNULL(SUM(车丝13),0) as 车丝13年累计,
ISNULL(SUM(车丝14),0) as 车丝14年累计,
ISNULL(SUM(车丝15),0) as 车丝15年累计,
ISNULL(SUM(车丝16),0) as 车丝16年累计,
ISNULL(SUM(车丝17),0) as 车丝17年累计,
ISNULL(SUM(车丝18),0) as 车丝18年累计,
ISNULL(SUM(车丝19),0) as 车丝19年累计,
ISNULL(SUM(车丝20),0) as 车丝20年累计
from 生产进度3 where 日期>=@d3 and 日期<=@d1
) t3
,
(select
ISNULL(SUM(磷化支数),0) as 套管接箍入库支
from 生产进度3 where 日期=@d1 and 产品类别ID=2
)
t4
,
(select
ISNULL(SUM(磷化支数),0) as 套管接箍入库累计支
from 生产进度3 where 日期>=@d2 and 日期<=@d1 and 产品类别ID=2
)
t5
,
(select
ISNULL(SUM(磷化支数),0) as 套管接箍入库年累计支
from 生产进度3 where 日期>=@d3 and 日期<=@d1 and 产品类别ID=2
)
t6
,
(select
ISNULL(SUM(磷化支数),0) as 油管接箍入库支
from 生产进度3 where 日期=@d1 and 产品类别ID=1
)
t7
,
(select
ISNULL(SUM(磷化支数),0) as 油管接箍入库累计支
from 生产进度3 where 日期>=@d2 and 日期<=@d1 and 产品类别ID=1
)
t8
,
(select
ISNULL(SUM(磷化支数),0) as 油管接箍入库年累计支
from 生产进度3 where 日期>=@d3 and 日期<=@d1 and 产品类别ID=1
)
t9";
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d1", "'" + this.d1.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d2", "'" + this.d2.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d3", "'" + this.d3.ToShortDateString() + "'");

    Reader = Cmd.ExecuteReader();

    if (Reader.Read())
    {
        for (i = 0; i < Reader.FieldCount; i++)
        {
            jindu3[i] = (int)(Reader[i]);
        }
    }
    Reader.Close();


    //四分厂日进度
    Cmd.CommandText = sql.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@d0", "'" + d1.ToShortDateString() + "'");
    Cmd.CommandText = Cmd.CommandText.Replace("@fc", "4");

    Reader = Cmd.ExecuteReader();
    if (this.Reader.Read())
    {
        this.d2 = (DateTime)this.Reader["月累计日期"];
        this.d3 = (DateTime)this.Reader["年累计日期"];
    }
    else
    {
        this.d2 = DateTime.Parse(this.d1.Year.ToString() + "-" + this.d1.Month.ToString() + "-1");
        this.d3 = DateTime.Parse(this.d1.Year.ToString() + "-1-1");
    }
    Reader.Close();


    Cmd.CommandText =
@"select * from
(select
ISNULL(SUM(车丝1),0) as 车丝1,
ISNULL(SUM(车丝2),0) as 车丝2,
ISNULL(SUM(车丝3),0) as 车丝3,
ISNULL(SUM(车丝4),0) as 车丝4
from 生产进度4 where 日期=@d1
) t1
,
(select
ISNULL(SUM(车丝1),0) as 车丝1累计,
ISNULL(SUM(车丝2),0) as 车丝2累计,
ISNULL(SUM(车丝3),0) as 车丝3累计,
ISNULL(SUM(车丝4),0) as 车丝4累计
from 生产进度4 where 日期>=@d2 and 日期<=@d1
) t2
,
(select
ISNULL(SUM(车丝1),0) as 车丝1年累计,
ISNULL(SUM(车丝2),0) as 车丝2年累计,
ISNULL(SUM(车丝3),0) as 车丝3年累计,
ISNULL(SUM(车丝4),0) as 车丝4年累计
from 生产进度4 where 日期>=@d3 and 日期<=@d1
) t3
,
(select
ISNULL(SUM(入库),0) as 套管保护器入库
from 生产进度4 where 产品类别ID=2 and 日期=@d1
) t4
,
(select
ISNULL(SUM(入库),0) as 套管保护器入库累计
from 生产进度4 where 产品类别ID=2 and 日期>=@d2 and 日期<=@d1
) t5
,
(select
ISNULL(SUM(入库),0) as 套管保护器入库年累计
from 生产进度4 where 产品类别ID=2 and 日期>=@d3 and 日期<=@d1
) t6

";
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d1", "'" + this.d1.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d2", "'" + this.d2.ToShortDateString() + "'");
    this.Cmd.CommandText = this.Cmd.CommandText.Replace("@d3", "'" + this.d3.ToShortDateString() + "'");

    Reader = Cmd.ExecuteReader();

    if (Reader.Read())
    {
        for (i = 0; i < Reader.FieldCount; i++)
        {
            for (i = 0; i < Reader.FieldCount; i++)
            {
                jindu4[i] = (int)(Reader[i]);
            }
        }
    }
    Reader.Close();

    Conn.Close();
    Reader.Dispose();
    Cmd.Dispose();
    Conn.Dispose();
    
%>
<div id="wintop" class="wintop">生产进度日报表</div>
<asp:Panel ID="Panel1" runat="server" CssClass="panel">
    日期：<asp:TextBox ID="Date1" runat="server" CssClass="textbox" Width="110px"  AutoPostBack="true"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
    <input type="button" value="导出报表" class="mbutton" onclick="Export();"/>
    <span style="margin-left:20px;"></span>分厂进度数据：
    <asp:Image ID="Image1" ImageUrl="/images/shangbao-1.png" runat="server" ImageAlign="AbsMiddle" /> 一分厂
    <span style="margin-left:20px;"></span><asp:Image ID="Image2" ImageUrl="/images/shangbao-1.png" runat="server" ImageAlign="AbsMiddle" /> 二分厂
    <span style="margin-left:20px;"></span><asp:Image ID="Image3" ImageUrl="/images/shangbao-1.png" runat="server" ImageAlign="AbsMiddle" /> 三分厂
    <span style="margin-left:20px;"></span><asp:Image ID="Image4" ImageUrl="/images/shangbao-1.png" runat="server" ImageAlign="AbsMiddle" /> 四分厂
    <span style="margin-left:20px;"></span><asp:Image ID="Image5" ImageUrl="/images/shangbao-1.png" runat="server" ImageAlign="AbsMiddle" /> 五分厂
</asp:Panel>

<asp:Panel ID="Panel2" runat="server" CssClass="panel3">
<style type="text/css">
tr{height:23px}
td{text-align:center; font-family:宋体;font-size:10pt;}
td.s0{border:.5pt solid #000000;}
td.s1{border:.5pt solid #000000;border-right:1pt double #000000;}
td.s2{border:.5pt solid #000000;border-bottom:1pt double #000000;}
td.s3{border:.5pt solid #000000;border-right:1pt double #000000;border-bottom:1pt double #000000;}
br{mso-data-placement:same-cell;}

</style>

<table border="0" width="1020" cellpadding="0" cellspacing="0" style="border-collapse:collapse;">
<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />
<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />

<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />
<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />

<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />
<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />

<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />
<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />

<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />
<col width="20" /><col width="20" /><col width="20" /><col width="20" /><col width="20" />

<col width="20" />

<tr>
<td colspan="51" height="30" style="font-size:20pt; font-family:黑体;">生　产　进　度　日　报　表</td>
</tr>
<tr>
<td></td>
<td colspan="10" style="font-size:12pt; font-family:黑体;text-align:left;">填报单位：生产处</td>
<td colspan="29" style="font-size:12pt; font-family:黑体;"><%=this.Date1.Text %></td>
<td colspan="10" style="font-size:12pt; text-align:right;">编号：SYC/ZJ-SC-09</td>
<td></td>
</tr>

<tr>
<td class="s0" colspan="3" style="font-size:12pt; font-family:黑体;">分 类</td>
<td class="s0" colspan="6" style="font-size:12pt; font-family:黑体;">分 厂</td>
<td class="s1" colspan="12" style="font-size:12pt; font-family:黑体;">一分厂</td>
<td class="s1" colspan="18" style="font-size:12pt; font-family:黑体;">二分厂</td>
<td class="s0" colspan="12" style="font-size:12pt; font-family:黑体;">五分厂</td>
</tr>

<tr>
<td class="s2" colspan="3" rowspan="3" style="font-size:12pt;">车丝量</td>
<td class="s0" colspan="6" style="font-size:12pt;">车丝机</td>
<td class="s0" colspan="3" style="font-size:12pt;">1#</td>
<td class="s0" colspan="3" style="font-size:12pt;">2#</td>
<td class="s0" colspan="3" style="font-size:12pt;">3#</td>
<td class="s1" colspan="3" style="font-size:12pt;">4#</td>
<td class="s0" colspan="3" style="font-size:12pt;">1#</td>
<td class="s0" colspan="3" style="font-size:12pt;">2#</td>
<td class="s0" colspan="3" style="font-size:12pt;">3#</td>
<td class="s0" colspan="3" style="font-size:12pt;">4#</td>
<td class="s0" colspan="3" style="font-size:12pt;">5#</td>
<td class="s1" colspan="3" style="font-size:12pt;">6#</td>
<td class="s0" colspan="3" style="font-size:12pt;">1#</td>
<td class="s0" colspan="3" style="font-size:12pt;">2#</td>
<td class="s0" colspan="3" style="font-size:12pt;">3#</td>
<td class="s0" colspan="3" style="font-size:12pt;">4#</td>
</tr>

<tr>
<td class="s0" colspan="6" style="font-size:12pt;">当日（支）</td>
<td class="s0" colspan="3"><%=jindu1[0] %></td>
<td class="s0" colspan="3"><%=jindu1[1] %></td>
<td class="s0" colspan="3"><%=jindu1[2] %></td>
<td class="s1" colspan="3"><%=jindu1[3] %></td>
<td class="s0" colspan="3"><%=jindu2[0] %></td>
<td class="s0" colspan="3"><%=jindu2[1] %></td>
<td class="s0" colspan="3"><%=jindu2[2] %></td>
<td class="s0" colspan="3"><%=jindu2[3] %></td>
<td class="s0" colspan="3"><%=jindu2[4] %></td>
<td class="s1" colspan="3"><%=jindu2[5] %></td>
<td class="s0" colspan="3"><%=jindu5[0] %></td>
<td class="s0" colspan="3"><%=jindu5[1] %></td>
<td class="s0" colspan="3"><%=jindu5[2] %></td>
<td class="s0" colspan="3"><%=jindu5[3] %></td>
</tr>

<tr>
<td class="s2" colspan="6" style="font-size:12pt;">累计（支）</td>
<td class="s2" colspan="3"><%=jindu1[4] %></td>
<td class="s2" colspan="3"><%=jindu1[5] %></td>
<td class="s2" colspan="3"><%=jindu1[6] %></td>
<td class="s3" colspan="3"><%=jindu1[7] %></td>
<td class="s2" colspan="3"><%=jindu2[6] %></td>
<td class="s2" colspan="3"><%=jindu2[7] %></td>
<td class="s2" colspan="3"><%=jindu2[8] %></td>
<td class="s2" colspan="3"><%=jindu2[9] %></td>
<td class="s2" colspan="3"><%=jindu2[10] %></td>
<td class="s3" colspan="3"><%=jindu2[11] %></td>
<td class="s2" colspan="3"><%=jindu5[4] %></td>
<td class="s2" colspan="3"><%=jindu5[5] %></td>
<td class="s2" colspan="3"><%=jindu5[6] %></td>
<td class="s2" colspan="3"><%=jindu5[7] %></td>
</tr>

<tr>
<td class="s2" colspan="3" rowspan="11" style="font-size:12pt;">产量</td>
<td class="s0" colspan="2" style="font-size:12pt;">产品</td>
<td class="s0" colspan="2" style="font-size:12pt;">分厂</td>
<td class="s0" colspan="2" style="font-size:12pt;">钢级</td>
<td class="s0" colspan="4" style="font-size:12pt;">项目</td>

<td class="s0" colspan="3" style="font-size:12pt;">单位</td>
<td class="s0" colspan="5" style="font-size:12pt;">当日</td>
<td class="s0" colspan="5" style="font-size:12pt;">本月累计</td>
<td class="s0" colspan="6" style="font-size:12pt;">本年累计</td>

<td class="s0" colspan="3" style="font-size:12pt;">单位</td>
<td class="s0" colspan="5" style="font-size:12pt;">当日</td>
<td class="s0" colspan="5" style="font-size:12pt;">本月累计</td>
<td class="s0" colspan="6" style="font-size:12pt;">本年累计</td>
</tr>

<tr>
<td class="s0" colspan="2" rowspan="6" style="font-size:12pt;">套管</td>
<td class="s0" colspan="2" rowspan="4" style="font-size:12pt;">一</td>
<td class="s0" colspan="2" rowspan="2" style="font-size:12pt;">J55</td>

<td class="s0" colspan="4">称重测长</td>
<td class="s0" colspan="3">支</td>
<td class="s0" colspan="5"><%=jindu1[8] %></td>
<td class="s0" colspan="5"><%=jindu1[14] %></td>
<td class="s0" colspan="6"><%=jindu1[20] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu1[11] %></td>
<td class="s0" colspan="5"><%=jindu1[17] %></td>
<td class="s0" colspan="6"><%=jindu1[23] %></td>
</tr>

<tr>
<td class="s0" colspan="4">成品入库</td>
<td class="s0" colspan="3">捆</td>
<td class="s0" colspan="5"><%=jindu1[10] %></td>
<td class="s0" colspan="5"><%=jindu1[16] %></td>
<td class="s0" colspan="6"><%=jindu1[22] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu1[13] %></td>
<td class="s0" colspan="5"><%=jindu1[19] %></td>
<td class="s0" colspan="6"><%=jindu1[25] %></td>
</tr>

<tr>
<td class="s0" colspan="2" rowspan="2" style="font-size:12pt;">N80Q</td>

<td class="s0" colspan="4">称重测长</td>
<td class="s0" colspan="3">支</td>
<td class="s0" colspan="5"><%=jindu1[26] %></td>
<td class="s0" colspan="5"><%=jindu1[32] %></td>
<td class="s0" colspan="6"><%=jindu1[38] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu1[29] %></td>
<td class="s0" colspan="5"><%=jindu1[35] %></td>
<td class="s0" colspan="6"><%=jindu1[41] %></td>
</tr>

<tr>
<td class="s0" colspan="4">成品入库</td>
<td class="s0" colspan="3">捆</td>
<td class="s0" colspan="5"><%=jindu1[28] %></td>
<td class="s0" colspan="5"><%=jindu1[34] %></td>
<td class="s0" colspan="6"><%=jindu1[40] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu1[31] %></td>
<td class="s0" colspan="5"><%=jindu1[37] %></td>
<td class="s0" colspan="6"><%=jindu1[43] %></td>
</tr>


<tr>
<td class="s0" colspan="2" rowspan="2" style="font-size:12pt;">二</td>
<td class="s0" colspan="2" rowspan="2" style="font-size:12pt;">J55</td>

<td class="s0" colspan="4">称重测长</td>
<td class="s0" colspan="3">支</td>
<td class="s0" colspan="5"><%=jindu2[12] %></td>
<td class="s0" colspan="5"><%=jindu2[18] %></td>
<td class="s0" colspan="6"><%=jindu2[24] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu2[15] %></td>
<td class="s0" colspan="5"><%=jindu2[21] %></td>
<td class="s0" colspan="6"><%=jindu2[27] %></td>
</tr>

<tr>
<td class="s0" colspan="4">成品入库</td>
<td class="s0" colspan="3">捆</td>
<td class="s0" colspan="5"><%=jindu2[14] %></td>
<td class="s0" colspan="5"><%=jindu2[20] %></td>
<td class="s0" colspan="6"><%=jindu2[26] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu2[17] %></td>
<td class="s0" colspan="5"><%=jindu2[23] %></td>
<td class="s0" colspan="6"><%=jindu2[29] %></td>
</tr>


<tr>
<td class="s2" colspan="2" rowspan="4" style="font-size:12pt;">油管</td>
<td class="s0" colspan="2" rowspan="2" style="font-size:12pt;">二</td>
<td class="s0" colspan="2" rowspan="2" style="font-size:12pt;">J55</td>

<td class="s0" colspan="4">称重测长</td>
<td class="s0" colspan="3">支</td>
<td class="s0" colspan="5"><%=jindu2[30] %></td>
<td class="s0" colspan="5"><%=jindu2[36] %></td>
<td class="s0" colspan="6"><%=jindu2[42] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu2[33] %></td>
<td class="s0" colspan="5"><%=jindu2[39] %></td>
<td class="s0" colspan="6"><%=jindu2[45] %></td>
</tr>

<tr>
<td class="s0" colspan="4">成品入库</td>
<td class="s0" colspan="3">捆</td>
<td class="s0" colspan="5"><%=jindu2[32] %></td>
<td class="s0" colspan="5"><%=jindu2[38] %></td>
<td class="s0" colspan="6"><%=jindu2[44] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu2[35] %></td>
<td class="s0" colspan="5"><%=jindu2[41] %></td>
<td class="s0" colspan="6"><%=jindu2[47] %></td>
</tr>

<tr>
<td class="s2" colspan="2" rowspan="2" style="font-size:12pt;">五</td>
<td class="s2" colspan="2" rowspan="2" style="font-size:12pt;">J55</td>

<td class="s0" colspan="4">称重测长</td>
<td class="s0" colspan="3">支</td>
<td class="s0" colspan="5"><%=jindu5[8] %></td>
<td class="s0" colspan="5"><%=jindu5[14] %></td>
<td class="s0" colspan="6"><%=jindu5[20] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu5[11] %></td>
<td class="s0" colspan="5"><%=jindu5[17] %></td>
<td class="s0" colspan="6"><%=jindu5[23] %></td>
</tr>

<tr>
<td class="s0" colspan="4">成品入库</td>
<td class="s0" colspan="3">捆</td>
<td class="s0" colspan="5"><%=jindu5[10] %></td>
<td class="s0" colspan="5"><%=jindu5[16] %></td>
<td class="s0" colspan="6"><%=jindu5[22] %></td>

<td class="s0" colspan="3">kg</td>
<td class="s0" colspan="5"><%=jindu5[13] %></td>
<td class="s0" colspan="5"><%=jindu5[19] %></td>
<td class="s0" colspan="6"><%=jindu5[25] %></td>
</tr>

<tr>
<td class="s2" colspan="3" rowspan="3" style="font-size:12pt;line-height:18pt;">合计<br />(kg)</td>
<td class="s0" colspan="3" rowspan="2" style="font-size:12pt;">套管</td>
<td class="s0" colspan="3" style="font-size:12pt;">J55</td>
<td class="s2" colspan="2" rowspan="3" style="font-size:12pt;line-height:18pt;">当日<br />生产</td>
<td class="s0" colspan="4"><%=jindu1[11] + jindu2[15]%></td>
<td class="s2" colspan="2" rowspan="3" style="font-size:12pt;line-height:18pt;">本月<br />生产</td>
<td class="s0" colspan="5"><%=jindu1[17]+jindu2[21]%></td>
<td class="s2" colspan="2" rowspan="3" style="font-size:12pt;line-height:18pt;">本年<br />生产</td>
<td class="s0" colspan="6"><%=jindu1[23]+jindu2[27]%></td>
<td class="s2" colspan="2" rowspan="3" style="font-size:12pt;line-height:18pt;">当日<br />入库</td>
<td class="s0" colspan="4"><%=jindu1[13]+jindu2[17]%></td>
<td class="s2" colspan="2" rowspan="3" style="font-size:12pt;line-height:18pt;">本月<br />入库</td>
<td class="s0" colspan="5"><%=jindu1[19]+jindu2[23]%></td>
<td class="s2" colspan="2" rowspan="3" style="font-size:12pt;line-height:18pt;">本年<br />入库</td>
<td class="s0" colspan="6"><%=jindu1[25]+jindu2[29]%></td>
</tr>

<tr>
<td class="s0" colspan="3"style="font-size:12pt;">N80Q</td>
<td class="s0" colspan="4"><%=jindu1[29]%></td>
<td class="s0" colspan="5"><%=jindu1[35]%></td>
<td class="s0" colspan="6"><%=jindu1[41]%></td>
<td class="s0" colspan="4"><%=jindu1[31]%></td>
<td class="s0" colspan="5"><%=jindu1[37]%></td>
<td class="s0" colspan="6"><%=jindu1[43]%></td>
</tr>
<tr>
<td class="s2" colspan="3" style="font-size:12pt;">油管</td>
<td class="s2" colspan="3"style="font-size:12pt;">J55</td>
<td class="s2" colspan="4"><%=jindu5[11]+jindu2[33]%></td>
<td class="s2" colspan="5"><%=jindu5[17]+jindu2[39]%></td>
<td class="s2" colspan="6"><%=jindu5[23]+jindu2[45]%></td>
<td class="s2" colspan="4"><%=jindu5[13]+jindu2[35]%></td>
<td class="s2" colspan="5"><%=jindu5[19]+jindu2[41]%></td>
<td class="s2" colspan="6"><%=jindu5[25]+jindu2[47]%></td>
</tr>
<tr>
<td class="s0" colspan="9" style="font-size:12pt; font-family:黑体;">分 厂</td>
<td class="s1" colspan="26" style="font-size:12pt; font-family:黑体;">三分厂</td>
<td class="s0" colspan="16" style="font-size:12pt; font-family:黑体;">四分厂</td>
</tr>

<tr>
<td class="s0" colspan="9" style="font-size:12pt;">车丝机</td>
<td class="s0" colspan="2" style="font-size:12pt;">1#</td>
<td class="s0" colspan="2" style="font-size:12pt;">2#</td>
<td class="s0" colspan="2" style="font-size:12pt;">3#</td>
<td class="s0" colspan="2" style="font-size:12pt;">4#</td>
<td class="s0" colspan="2" style="font-size:12pt;">5#</td>
<td class="s0" colspan="2" style="font-size:12pt;">6#</td>
<td class="s0" colspan="2" style="font-size:12pt;">7#</td>
<td class="s0" colspan="2" style="font-size:12pt;">8#</td>
<td class="s0" colspan="2" style="font-size:12pt;">9#</td>
<td class="s0" colspan="2" style="font-size:12pt;">10#</td>
<td class="s0" colspan="2" style="font-size:12pt;">11#</td>
<td class="s0" colspan="2" style="font-size:12pt;">12#</td>
<td class="s1" colspan="2" style="font-size:12pt;">13#</td>

<td class="s0" colspan="4" style="font-size:12pt;">1#</td>
<td class="s0" colspan="4" style="font-size:12pt;">2#</td>
<td class="s0" colspan="4" style="font-size:12pt;">3#</td>
<td class="s0" colspan="4" style="font-size:12pt;">4#</td>
</tr>
<tr>
<td class="s0" colspan="9" style="font-size:12pt;">当日（支）</td>
<td class="s0" colspan="2"><%=jindu3[0] %></td>
<td class="s0" colspan="2"><%=jindu3[1] %></td>
<td class="s0" colspan="2"><%=jindu3[2] %></td>
<td class="s0" colspan="2"><%=jindu3[3] %></td>
<td class="s0" colspan="2"><%=jindu3[4] %></td>
<td class="s0" colspan="2"><%=jindu3[5] %></td>
<td class="s0" colspan="2"><%=jindu3[6] %></td>
<td class="s0" colspan="2"><%=jindu3[7] %></td>
<td class="s0" colspan="2"><%=jindu3[8] %></td>
<td class="s0" colspan="2"><%=jindu3[9] %></td>
<td class="s0" colspan="2"><%=jindu3[10] %></td>
<td class="s0" colspan="2"><%=jindu3[11] %></td>
<td class="s1" colspan="2"><%=jindu3[12] %></td>

<td class="s0" colspan="4"><%=jindu4[0] %></td>
<td class="s0" colspan="4"><%=jindu4[1] %></td>
<td class="s0" colspan="4"><%=jindu4[2] %></td>
<td class="s0" colspan="4"><%=jindu4[3] %></td>
</tr>
<tr>
<td class="s0" colspan="9" style="font-size:12pt;">累计（支）</td>
<td class="s0" colspan="2"><%=jindu3[20] %></td>
<td class="s0" colspan="2"><%=jindu3[21] %></td>
<td class="s0" colspan="2"><%=jindu3[22] %></td>
<td class="s0" colspan="2"><%=jindu3[23] %></td>
<td class="s0" colspan="2"><%=jindu3[24] %></td>
<td class="s0" colspan="2"><%=jindu3[25] %></td>
<td class="s0" colspan="2"><%=jindu3[26] %></td>
<td class="s0" colspan="2"><%=jindu3[27] %></td>
<td class="s0" colspan="2"><%=jindu3[28] %></td>
<td class="s0" colspan="2"><%=jindu3[29] %></td>
<td class="s0" colspan="2"><%=jindu3[30] %></td>
<td class="s0" colspan="2"><%=jindu3[31] %></td>
<td class="s1" colspan="2"><%=jindu3[32] %></td>

<td class="s0" colspan="4"><%=jindu4[4] %></td>
<td class="s0" colspan="4"><%=jindu4[5] %></td>
<td class="s0" colspan="4"><%=jindu4[6] %></td>
<td class="s0" colspan="4"><%=jindu4[7] %></td>
</tr>

<tr>
<td class="s0" colspan="9" style="font-size:12pt;">名称</td>
<td class="s0" colspan="2" style="font-size:12pt;">单位</td>
<td class="s0" colspan="3" style="font-size:12pt;">当日</td>
<td class="s0" colspan="4" style="font-size:12pt;">本月累计</td>
<td class="s0" colspan="4" style="font-size:12pt;">本年累计</td>

<td class="s0" colspan="2" style="font-size:12pt;">单位</td>
<td class="s0" colspan="3" style="font-size:12pt;">当日</td>
<td class="s0" colspan="4" style="font-size:12pt;">本月累计</td>
<td class="s1" colspan="4" style="font-size:12pt;">本年累计</td>

<td class="s0" colspan="3" style="font-size:12pt;">名称</td>
<td class="s0" colspan="2" style="font-size:12pt;">单位</td>
<td class="s0" colspan="3" style="font-size:12pt;">当日</td>
<td class="s0" colspan="4" style="font-size:12pt;">本月累计</td>
<td class="s0" colspan="4" style="font-size:12pt;">本年累计</td>
</tr>

<tr>
<td class="s0" colspan="9" style="font-size:12pt;">套管接箍</td>
<td class="s0" colspan="2">支</td>
<td class="s0" colspan="3"><%=jindu3[0] + jindu3[1] + jindu3[2] + jindu3[3] + jindu3[4] + jindu3[5] + jindu3[6]%></td>
<td class="s0" colspan="4"><%=jindu3[20] + jindu3[21] + jindu3[22] + jindu3[23] + jindu3[24] + jindu3[25] + jindu3[26]%></td>
<td class="s0" colspan="4"><%=jindu3[40] + jindu3[41] + jindu3[42] + jindu3[43] + jindu3[44] + jindu3[45] + jindu3[46]%></td>

<td class="s0" colspan="2">kg</td>
<td class="s0" colspan="3"><%=(jindu3[0] + jindu3[1] + jindu3[2] + jindu3[3] + jindu3[4] + jindu3[5] + jindu3[6])*6.1%></td>
<td class="s0" colspan="4"><%=(jindu3[20] + jindu3[21] + jindu3[22] + jindu3[23] + jindu3[24] + jindu3[25] + jindu3[26])*6.1%></td>
<td class="s1" colspan="4"><%=(jindu3[40] + jindu3[41] + jindu3[42] + jindu3[43] + jindu3[44] + jindu3[45] + jindu3[46])*6.1%></td>

<td class="s0" colspan="2" rowspan="2">护丝<br />生产</td>
<td class="s0">内</td>
<td class="s0" colspan="2">个</td>
<td class="s0" colspan="3"><%=jindu4[0] + jindu4[1]%></td>
<td class="s0" colspan="4"><%=jindu4[4] + jindu4[5]%></td>
<td class="s0" colspan="4"><%=jindu4[8] + jindu4[9]%></td>
</tr>

<tr>
<td class="s0" colspan="9" style="font-size:12pt;">套管接箍入库</td>
<td class="s0" colspan="2">支</td>
<td class="s0" colspan="3"><%=jindu3[60] %></td>
<td class="s0" colspan="4"><%=jindu3[61] %></td>
<td class="s0" colspan="4"><%=jindu3[62] %></td>

<td class="s0" colspan="2">kg</td>
<td class="s0" colspan="3"><%=jindu3[60] * 6.1%></td>
<td class="s0" colspan="4"><%=jindu3[61] * 6.1%></td>
<td class="s1" colspan="4"><%=jindu3[62] * 6.1%></td>


<td class="s0">外</td>
<td class="s0" colspan="2">个</td>
<td class="s0" colspan="3"><%=jindu4[2] + jindu4[3]%></td>
<td class="s0" colspan="4"><%=jindu4[6] + jindu4[7]%></td>
<td class="s0" colspan="4"><%=jindu4[10] + jindu4[11]%></td>
</tr>


<tr>
<td class="s0" colspan="9" style="font-size:12pt;">油管接箍</td>
<td class="s0" colspan="2">支</td>
<td class="s0" colspan="3"><%=jindu3[7] + jindu3[8] + jindu3[9] + jindu3[10] + jindu3[11] + jindu3[12] %></td>
<td class="s0" colspan="4"><%=jindu3[27] + jindu3[28] + jindu3[29] + jindu3[30] + jindu3[31] + jindu3[32] %></td>
<td class="s0" colspan="4"><%=jindu3[47] + jindu3[48] + jindu3[49] + jindu3[50] + jindu3[51] + jindu3[52]%></td>

<td class="s0" colspan="2">kg</td>
<td class="s0" colspan="3"><%=(jindu3[7] + jindu3[7] + jindu3[9] + jindu3[10] + jindu3[11] + jindu3[12]) * 2.3%></td>
<td class="s0" colspan="4"><%=(jindu3[27] + jindu3[28] + jindu3[29] + jindu3[30] + jindu3[31] + jindu3[32]) * 2.3%></td>
<td class="s1" colspan="4"><%=(jindu3[47] + jindu3[48] + jindu3[49] + jindu3[50] + jindu3[51] + jindu3[52]) * 2.3%></td>

<td class="s0" colspan="3" rowspan="2">护丝<br />入库</td>
<td class="s0" colspan="2" rowspan="2">套</td>
<td class="s0" colspan="3" rowspan="2"><%=jindu4[12] %></td>
<td class="s0" colspan="4" rowspan="2"><%=jindu4[13] %></td>
<td class="s0" colspan="4" rowspan="2"><%=jindu4[14] %></td>
</tr>

<tr>
<td class="s0" colspan="9" style="font-size:12pt;">油管接箍入库</td>
<td class="s0" colspan="2">支</td>
<td class="s0" colspan="3"><%=jindu3[63] %></td>
<td class="s0" colspan="4"><%=jindu3[64] %></td>
<td class="s0" colspan="4"><%=jindu3[65] %></td>

<td class="s0" colspan="2">kg</td>
<td class="s0" colspan="3"><%=jindu3[63] * 2.3%></td>
<td class="s0" colspan="4"><%=jindu3[64] * 2.3%></td>
<td class="s1" colspan="4"><%=jindu3[65] * 2.3 %></td>
</tr>

<tr>
<td colspan="2"></td>
<td colspan="9" style="font-size:12pt; font-family:黑体;text-align:left;">负责人：廉宝仁</td>
<td colspan="29"></td>
<td colspan="9" style="font-size:12pt; font-family:黑体;text-align:right;">制表人：赵俐姝</td>
<td colspan="2"></td>
</tr>
<tr>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td><td width="20"></td>
<td width="20"></td>
</tr>
</table>
</asp:Panel>
</form>

<form id="form2" method="post" action="/PageExport.ashx">
<input type="hidden" name="filename" value="生产进度日报表.xls" />
<input type="hidden" name="content" value="" />
</form>

<script type="text/javascript">
    var notice = '<%=this.Notice %>';
    if (notice != '') {
        parent.showmsgbox(notice);
    }
</script>
<script type="text/javascript">
var textboxs = document.getElementsByTagName("input");
for (var i = 0; i < textboxs.length; i++) {
    if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "intxt2") {
        textboxs[i].onfocus = function(e) { this.select(); };
    }
}
function Export() {
    form2.content.value =
"<html xmlns:o='urn:schemas-microsoft-com:office:office'\nxmlns:x='urn:schemas-microsoft-com:office:excel'\nxmlns='http://www.w3.org/TR/REC-html40'>\n<head>\n<meta http-equiv=Content-Type content='text/html; charset=utf-8'>\n<style>\n<!--table\n@page\n{mso-header-data:;\nmso-footer-data:;\nmargin:.39in .31in .39in .31in;mso-header-margin:.31in;mso-footer-margin:.31in;\nmso-page-orientation:landscape;\nmso-horizontal-page-align:center;\n}\n-->\n</style>\n<!--[if gte mso 9]><xml>\n<x:ExcelWorkbook>\n<x:ExcelWorksheets>\n<x:ExcelWorksheet>\n<x:Name>生产进度日报表</x:Name>\n<x:WorksheetOptions>\n<x:DefaultRowHeight>285</x:DefaultRowHeight>\n<x:Print>\n<x:ValidPrinterInfo/>\n<x:Scale>100</x:Scale>\n<x:PaperSizeIndex>9</x:PaperSizeIndex>\n<x:HorizontalResolution>200</x:HorizontalResolution>\n<x:VerticalResolution>200</x:VerticalResolution>\n</x:Print>\n<x:Selected/>\n<x:Panes>\n<x:Pane>\n<x:Number>3</x:Number>\n<x:ActiveRow>0</x:ActiveRow>\n<x:ActiveCol>0</x:ActiveCol>\n</x:Pane>\n</x:Panes>\n</x:WorksheetOptions>\n</x:ExcelWorksheet>\n</x:ExcelWorkbook>\n</xml><![endif]-->\n</head>\n<body>"
            + document.getElementById("Panel2").innerHTML
            + "</body></html>";
    form2.submit();
}

parent.hidesubmenu(true);
</script>
</body>
</html>